<%@ page session="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<tr:panelGroupLayout partialTriggers="resetButton">
		<fieldset><legend><h:outputText value="Wyszukiwanie" /></legend>
		<table width="100%" cellpadding="0" cellspacing="3" border="0">
			<tr>
				<td align="right"><h:outputText value="Numer:" /></td>
				<td>
				<tr:inputText simple="true" contentStyle="width:100%"
				 					partialTriggers="resetButton"
									value="#{OrderSearchCondition.number}" />
				</td>
				<td align="right" valign="top" title="Dotyczy tylko artykułów">
				Produkt:
				</td>
				
				<td align="right" valign="top" title="Dotyczy tylko artykułów">
					<tr:inputText simple="true" contentStyle="width:100%"
					 				partialTriggers="resetButton"
									value="#{OrderSearchCondition.product}" />
				</td>				
				<td rowspan="3" valign="top" align="right">
				<tr:selectManyListbox value="#{OrderSearchCondition.status}"
				 						partialTriggers="resetButton"
				 						contentStyle="width:70%;border:1px solid gray"
										simple="true" size="8">
					<f:selectItems value="#{ConstantDictionaries.orderStatus}" />
				</tr:selectManyListbox>
				</td>
			</tr>
			<tr>
			<td align="right">Email:</td>
			<td><tr:inputText simple="true" id="email" partialTriggers="resetButton"
								value="#{OrderSearchCondition.email}" contentStyle="width:100%">
					<f:validator validatorId="EmailValidator" />
					</tr:inputText> <h:message for="email" styleClass="validation_info"
					style="display:block" />
			</td>
			<td align="right">Osoba zamawiająca:</td>
			<td><tr:inputText simple="true" partialTriggers="resetButton"
								value="#{OrderSearchCondition.clientName}"
								contentStyle="width:100%" />
			</td>
			<td rowspan="2" valign="top" align="right">
				
				<tr:selectManyListbox value="#{OrderSearchCondition.additionalStatus}"
				 							partialTriggers="resetButton"
				 							contentStyle="width:70%;border:1px solid gray"
											simple="true" size="4">
					<f:selectItems value="#{ConstantDictionaries.additionalStatus}" />
				</tr:selectManyListbox>
			</td>
			</tr>
			<tr>
			<td align="right">Odpowiedzialna:</td>
			<td align="left">
                    <tr:selectOneChoice value="#{OrderSearchCondition.salesmanResponsible}" 
                                    simple="true" partialTriggers="resetButton" contentStyle="width:100%"
                                    shortDesc="Wybierz zamówienia, ktore realizuje dana osoba">
                        <f:selectItem itemLabel="-- wszystkie -- "/>
                    	<f:selectItems value="#{salesmanController.salesmanItems}"/>
                	</tr:selectOneChoice>				
			</td>
			<td align="right">
				<tr:selectBooleanCheckbox shortDesc="Wyszukuj również oferty" 
											label="Pokaż oferty" 
											value="#{OrderSearchCondition.searchInOffers}"/>
			</td>
			<td>
				<tr:panelGroupLayout>
					<tr:commandButton id="searchButton" 
										inlineStyle="width:80%;background-color:orange;margin:0"
										text="Szukaj" action="#{orderController.searchOrders}" />
					<tr:commandLink actionListener="#{orderController.resetSearchFilter}" partialSubmit="true"
									id="resetButton"
									shortDesc="Zresetuj filtr wyszukiwania" inlineStyle="margin-left:5px">
						<tr:image source="gfx/icon/reset.png" inlineStyle="margin:0" />
					</tr:commandLink>
				</tr:panelGroupLayout>
			</td>
			</tr>
		</table>
		</fieldset>
</tr:panelGroupLayout>